<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org"
	xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">

<head th:include="include :: header"></head>
<!-- 每日收益页面 -->
<body class="gray-bg" style="background-color: white;">

		<div class="container-div">
		<div style="margin-left: 45px;margin-top: 30px">
			<!-- 跳转到每日收益列表页面 -->
			<a  onclick="toMoreMoney()" 
				class="btn btn-primary">查看更多收益
			</a>
		</div>
		<div id="container" style="height: 90%;width:90%"></div>
	</div>
	<div th:include="include :: footer"></div>
	<!-- 画图表部分 -->
       <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/echarts.min.js"></script>
       <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts-gl/echarts-gl.min.js"></script>
       <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts-stat/ecStat.min.js"></script>
       <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/extension/dataTool.min.js"></script>
       <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/echarts/extension/bmap.min.js"></script>
       <script type="text/javascript" src="http://echarts.baidu.com/gallery/vendors/simplex.js"></script>
		<script th:inline="javascript">
		var prefix = ctx + "system/hatchetMoneyChangeForDLS";
		//跳转查看更多收益
		function toMoreMoney(){
			window.location.href=ctx+"system/hatchetMoneyChangeForDLS/5";
		}
		$(document).ready(function() {
		     //画柱状图       
			var days = [];
			var moneys = [];
			$.ajax({
				url :prefix+"/fenRunForDLSByWeek" ,
				type : 'post',
				async:false,
				dataType : 'json',
				success : function(data) {
					$.each(data, function(index, obj) {
						moneys.push(obj.trxAmt);
						days.push(obj.time);
					});
					var dom = document.getElementById("container");
					var myChart = echarts.init(dom);
					var app = {};
					option = null;
					app.title = '坐标轴刻度与标签对齐';

					option = {
					    color: ['#3398DB'],
					    tooltip : {
					        trigger: 'axis',
					        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
					            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
					        }
					    },
					    grid: {
					        left: '3%',
					        right: '4%',
					        bottom: '3%',
					        containLabel: true
					    },
					    xAxis : [
					        {
					            type : 'category',
					            data : days,
					            axisTick: {
					                alignWithLabel: true
					            }
					        }
					    ],
					    yAxis : [
					        {
					            type : 'value'
					        }
					    ],
					    series : [
					        {
					            name:'当天收益（元）',
					            type:'bar',
					            barWidth: '40%',
					            data:moneys
					        }
					    ]
					};
					;
					if (option && typeof option === "object") {
					    myChart.setOption(option, true);
					}
				}
		}); 
	});	
	</script>
</body>
</html>